<template>
    <div class="wrapper">
        <div class="discuss">
            <div class="question-name">
                <template v-if="seq">
                    {{ seq }}.
                </template>
                <span class="q-text">{{ questionData.question }}
                    <span class="q-text-score">（分值：{{ questionData.score }}分）</span>
                </span>
                <div class="img-wrap" v-if="questionData.question_file">
                    <img :src="questionData.question_file" />
                </div>
            </div>
            <div class="question-content">
                <el-input :disabled="disable" type="textarea"  :autosize="{ minRows: 3, maxRows: 8}" v-model="questionData.fill_content"
                    @change="handleInput"></el-input>
            </div>

        </div>
    </div>
</template>

<script>
export default {
    name: 'discuss',
    components: {},
    props: ['seq', 'questionData', 'mode'],
    computed: {
        disable() {
            return this.mode === 'detail' || this.mode === 'score'|| this.mode === 'answer';
        }
    },
    data() {
        return {
        };
    },
    mounted() { },
    methods: {
        handleInput() {
            this.$emit('submitAnswer', {
                "question_id": this.questionData.question_id, // 考题id
                "fill_content": this.questionData.fill_content, // 填写内容
            });
        }
    },
};
</script>
<style lang="scss" scoped>
.wrapper {}
</style>